#!/bin/bash

# 本地service文件路径
local_file="./target_raw"

# 远程服务器地址
remote_server="root@175.178.192.160"

remote_path="/data"

server_file="target"

current_date_time=$(date +"%Y%m%d%H%M%S")


scp $local_file $remote_server:$remote_path

ssh $remote_server << EOF
  mv $remote_path/$server_file $remote_path/$server_file_$current_date_time
  mv $remote_path/$local_file $remote_path/$server_file
  chmod +x $remote_path/$server_file
  supervisorctl restart zsc
EOF